<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {

    protected function _initDoctype() {
        $this->bootstrap('view');
        $view = $this->getResource('view');
        $view->doctype('XHTML1_STRICT');
    }

    protected function _initDatabaseConnection() {
        // Setup database
        $con = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', APPLICATION_ENV);
        $db = Zend_Db::factory($con->resources->db);
        //  pre($db);
        $db->getProfiler()->setEnabled(false);
        Zend_Db_Table_Abstract::setDefaultAdapter($db);

        // Setup DB caching
        // $dbCache = Zend_Cache::factory('Core',
        //           'File',
        //           array('automatic_serialization' => true),
        //           array('cache_dir' => ROOT . 'cache/database'));
        //
        //
        //   Zend_Db_Table_Abstract::setDefaultMetadataCache($dbCache);
        //   Zend_Registry::set('db_cache', $dbCache);
    }
    
    protected function _initPrintLayout() {
        $cat = new Application_Model_Category();
        $pro = new Application_Model_Product();
        $this->view->catLayout = $cat->getAllCategories();
        $this->view->proLayout = $pro->getNewProducts();
        
    }

}

